package cn.bugstack.mcp.server.niuke.test;

import cn.bugstack.mcp.server.niuke.domain.model.ArticleFunctionRequest;
import cn.bugstack.mcp.server.niuke.domain.model.ArticleFunctionResponse;
import cn.bugstack.mcp.server.niuke.domain.service.NiuKeArticleService;
import com.alibaba.fastjson2.JSON;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;

@RunWith(SpringRunner.class)
@SpringBootTest
@Slf4j
public class ApiTest {
    @Resource
    private NiuKeArticleService niuKeArticleService;

    @Test
    public void test_01() throws IOException {
        ArticleFunctionRequest request = new ArticleFunctionRequest();
        request.setTitle("这是mcp服务的测试帖子");
        request.setMarkdownContent("这是mcp的测试内容哈哈哈哈");
        ArticleFunctionResponse response = niuKeArticleService.createArticle(request);
        log.info("这是测试结果: req:{}, res:{}", JSON.toJSONString(request), JSON.toJSONString(response));
    }
}
